# 定义类装饰器
class Check:
    # 接收待装饰的函数
    def __init__(self, fn):  # fn = comment
        self.__fn = fn

    def __call__(self, *args: object, **kwargs: object) -> object:
        print("登录")
        self.__fn()  # comment()


# 被装饰的函数
@Check  # comment = Check(comment)
def comment():
    print("发表评论")


comment()